<?php
echo "asdfasdf\n"
?>

<html>
<head>
    <title>十户香</title>
</head>
<body>
<h1>我的第一张 PHP 页面</h1>
<?php
echo "this is ten house rice body;"
?>
<?php
$x=15;
$y=10;

function myTest() {
    global $x,$y;
    $y=$x+$y;
    echo $y;
}

myTest();
echo $y; // 输出 15
echo "<br>";
echo time();

$x = 5985;
var_dump($x);
echo "<br>";
$x = -345; // 负数
var_dump($x);
echo "<br>";
$x = 0x8C; // 十六进制数
var_dump($x);
echo "<br>";
$x = 047; // 八进制数
var_dump($x);

$cars=array("Volvo","BMW","SAAB");
var_dump($cars);

class Car
{
    var $color;
    function Car($color="green") {
        $this->color = $color;
    }
    function what_color() {
        return $this->color;
    }
}

$carg = Car;

echo $_REQUEST['fname'];
?>


<form method="post" action="<?php echo $_SERVER['PHP_SELF'];?>">
    Name: <input type="text" name="fname">
    <input type="submit">
</form>

<?php
$name = $_REQUEST['fname'];
echo "this:";
echo $name;
echo "<br>";
?>


<a href="second.php?subject=PHP&web=W3school.com.cn">测试 $GET</a>

<form method="post" action="<?php echo $_SERVER['PHP_SELF'];?>">
    Name: <input type="text" name="fnamea">
    <input type="submit">
</form>

<?php
$name = $_POST['fnamea'];
echo $name;
?>


</body>
</html>